package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.dto.DoctorInfoDTO;
import com.example.pojo.Doctor;
import com.example.pojo.Hospital;
import com.example.pojo.HpDoc;
import com.example.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DoctorMapper {
    Doctor selectDoctorByDocId(@Param("docId") Integer docId);

    /**
     * 获取所有医生的信息
     *
     * @return 医生信息列表
     */
    @Select("SELECT * FROM doctor")
    List<Doctor> getAllDoctors();

//    //查询所有信息，以链表格式
//    // 查询所有医生信息
//    @Select("SELECT * FROM doctor")
//    List<Doctor> getAllDoctors();

//
//    @Select("SELECT * FROM doctor WHERE doc_id = #{docId}")
//    Doctor selectDoctorBydocId(@Param("docId") Integer docId);
//
//
//    @Select("SELECT * FROM doctor WHERE hpId = #{hpId}")
//    List<Doctor> findByHpId(@Param("hpId") Integer hpId);
//
//
//    // 根据用户ID查询用户
//    @Select("SELECT * FROM doctor WHERE docId = #{docId}")
//    Doctor selectDoctorByDoctId(@Param("docId") Integer docId);
//
//    @Select("SELECT d.real_name AS realName, d.sex, d.deptno, d.hp_id AS hpId, hd.dep_name AS depName, h.name AS hospitalName " +
//            "FROM doctor d " +
//            "LEFT JOIN hp_doc hd ON d.deptno = hd.deptno AND d.hp_id = hd.hp_id " +
//            "LEFT JOIN hospital h ON d.hp_id = h.hp_id " +
//            "WHERE d.doc_id = #{docId}")
//    DoctorInfoDTO findDoctorInfoDTOById(@Param("docId") Integer docId);
//
//    Doctor selectById(String docId);
//
//
//    @Select("SELECT * FROM doctor WHERE docId = #{docId}")
//    Doctor getDoctorById(String docId);
//
//    @Select("SELECT * FROM hospital WHERE hpId = #{hpId}")
//    Hospital getHospitalById(Integer hpId);
//
//    @Select("SELECT * FROM hpdoc WHERE hpId = #{hpId} AND deptno = #{deptno}")
//    List<HpDoc> getHpDocsByHpIdAndDeptno(Integer hpId, Integer deptno);

}
